
Page({

  /**
   * 页面的初始数据
   */
  data: {
    zh: '',
    schema:[],
    formData:{
    },
    title: '',
    result: '',
    remark: '',
    webUrl: '',
    apiName: '',
    showPrivacy: false
  },
  onUnload() {
    wx.offWindowResize()
  },
  onLoad(options) {
    console.log('options', options)
    wx.setNavigationBarTitle({
      title: options.title,
    })
    
    this.setData({
      title: options.title,
      zh:options.zh,
      remark: options.remark,
      webUrl: options.webUrl
    })
    if(options.zh === 'wx.offWindowResize') {
      wx.onWindowResize((res) => {
        this.setData({
          result: res,
          apiName: options.zh
        })
      })
    }
  },
  getFormData(e) {
    console.log('formdata==', e.detail.formData);
    this.setData({
      formData: e.detail.formData
    })
  },
  onWindowResize(e) {
    wx.onWindowResize((res) => {
      this.setData({
        result: res,
        apiName: e.currentTarget.dataset.apiname 
      })
    })
  },
  offWindowResize(e) {
    wx.offWindowResize((res) => {
      this.setData({
        result: res,
        apiName: e.currentTarget.dataset.apiname 
      })
    })
  },
  checkIsPictureInPictureActive(e) {
    const check = wx.checkIsPictureInPictureActive();
    this.setData({
      result: check,
      apiName: e.currentTarget.dataset.apiname
    })
  }
})